package com.ruoyi.project.learn.sscl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.learn.sscl.mapper.DjRealTimeMaterialMapper;
import com.ruoyi.project.learn.sscl.domain.DjRealTimeMaterial;
import com.ruoyi.project.learn.sscl.service.IDjRealTimeMaterialService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 实时材料Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-17
 */
@Service
public class DjRealTimeMaterialServiceImpl implements IDjRealTimeMaterialService 
{
    @Autowired
    private DjRealTimeMaterialMapper djRealTimeMaterialMapper;

    /**
     * 查询实时材料
     * 
     * @param id 实时材料主键
     * @return 实时材料
     */
    @Override
    public DjRealTimeMaterial selectDjRealTimeMaterialById(Long id)
    {
        return djRealTimeMaterialMapper.selectDjRealTimeMaterialById(id);
    }

    /**
     * 查询实时材料列表
     * 
     * @param djRealTimeMaterial 实时材料
     * @return 实时材料
     */
    @Override
    public List<DjRealTimeMaterial> selectDjRealTimeMaterialList(DjRealTimeMaterial djRealTimeMaterial)
    {
        return djRealTimeMaterialMapper.selectDjRealTimeMaterialList(djRealTimeMaterial);
    }

    /**
     * 新增实时材料
     * 
     * @param djRealTimeMaterial 实时材料
     * @return 结果
     */
    @Override
    public int insertDjRealTimeMaterial(DjRealTimeMaterial djRealTimeMaterial)
    {
        djRealTimeMaterial.setCreateTime(DateUtils.getNowDate());
        return djRealTimeMaterialMapper.insertDjRealTimeMaterial(djRealTimeMaterial);
    }

    /**
     * 修改实时材料
     * 
     * @param djRealTimeMaterial 实时材料
     * @return 结果
     */
    @Override
    public int updateDjRealTimeMaterial(DjRealTimeMaterial djRealTimeMaterial)
    {
        djRealTimeMaterial.setUpdateTime(DateUtils.getNowDate());
        return djRealTimeMaterialMapper.updateDjRealTimeMaterial(djRealTimeMaterial);
    }

    /**
     * 批量删除实时材料
     * 
     * @param ids 需要删除的实时材料主键
     * @return 结果
     */
    @Override
    public int deleteDjRealTimeMaterialByIds(String ids)
    {
        return djRealTimeMaterialMapper.deleteDjRealTimeMaterialByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除实时材料信息
     * 
     * @param id 实时材料主键
     * @return 结果
     */
    @Override
    public int deleteDjRealTimeMaterialById(Long id)
    {
        return djRealTimeMaterialMapper.deleteDjRealTimeMaterialById(id);
    }
}
